package org.jeecg.modules.jxc.sales_management.salelist_Search.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.apache.commons.lang.StringUtils;
import org.jeecg.modules.jxc.sales_management.salelist_Search.entity.JxcCustomerReturnLisjxcGoods;
import org.jeecg.modules.jxc.sales_management.salelist_Search.mapper.JxcCustomerReturnLisjxcGoodsMapper;
import org.jeecg.modules.jxc.sales_management.salelist_Search.service.IJxcCustomerReturnLisjxcGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.List;
import java.util.Map;

/**
 * @Description: jxc_customer_return_lisjxc_goods
 * @Author: jeecg-boot
 * @Date:   2021-12-22
 * @Version: V1.0
 */
@Service
public class JxcCustomerReturnLisjxcGoodsServiceImpl extends ServiceImpl<JxcCustomerReturnLisjxcGoodsMapper, JxcCustomerReturnLisjxcGoods> implements IJxcCustomerReturnLisjxcGoodsService {
@Autowired
private JxcCustomerReturnLisjxcGoodsMapper jxcCustomerReturnLisjxcGoodsMapper;
    @Override
    public JxcCustomerReturnLisjxcGoods selectById(String id) {
        return jxcCustomerReturnLisjxcGoodsMapper.selectgoodsById(id);
    }

    @Override
    public List<JxcCustomerReturnLisjxcGoods> selectBycustomerReturnListId(Integer customerReturnListId) {
        QueryWrapper<JxcCustomerReturnLisjxcGoods> queryWrapper = new QueryWrapper<>();
 queryWrapper.eq("customer_return_lisjxc_id",customerReturnListId);
        List<JxcCustomerReturnLisjxcGoods> jxcCustomerReturnLisjxcGoods = jxcCustomerReturnLisjxcGoodsMapper.selectList(queryWrapper);
        return  jxcCustomerReturnLisjxcGoods;
    }

    @Override
    public List<Map<String,Object>> selectall(String returnNumber, String saleDate_begin, String saleDate_end, Integer customerId, Integer state) {
        if (StringUtils.isEmpty(returnNumber))
            returnNumber = null;
        if (StringUtils.isEmpty(saleDate_begin))
           saleDate_begin=null;
        if (StringUtils.isEmpty(saleDate_end))
            saleDate_end=null;
        List<Map<String,Object>> jxcCustomerReturnLisjxcGoods = jxcCustomerReturnLisjxcGoodsMapper.selectListReturnList(returnNumber,saleDate_begin, saleDate_end,customerId,state);
        return jxcCustomerReturnLisjxcGoods;
    }


}
